Ruby on Rails - scope available locales in ruby on rails - ruby on rails tutorial - rails guides - rails tutorial - ruby rails
- Our application is available in different languages, we usually show the current locale in the URL.
scope '/(:locale)', locale: /#{I18n.available_locales.join('|')}/ do
root 'example#root'
# other routes
end
Clicking "Copy Code" button will copy the code into the clipboard - memory. Please paste(Ctrl+V) it in your destination. The code will get pasted. Happy coding from Wikitechy - ruby on rails tutorial - rails guides - ruby rails - rubyonrails - learn ruby on rails - team
- Our root will be accessible via the locales defined in I18n.available_locales.